home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "Unit1.h"
- #include "xlist.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- Xlist list;
- char s[80];
-
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::AddClick(TObject *Sender)
- {
- Xlist* p;
-
- p = new Xlist;
- list.Add(p);
- sprintf(s, "There are %d items", list.Count());
- Memo1->Lines->Add(s);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::RemoveClick(TObject *Sender)
- {
- Xlist *p;
-
- p = list.Remove();
- if (p != NULL)
- delete p;
- sprintf(s, "There are now %d items", list.Count());
- Memo1->Lines->Add(s);
-
- }
- //---------------------------------------------------------------------------